Vue.filter('date', function(date) {
    date = new Date(date)
    var year = date.getFullYear()
    var month = date.getMonth() + 1
    var day = date.getDate()
    var hour = date.getHours()
    var minute = date.getMinutes()

    return year + '-' + month + '-' + format(day) + ' ' + hour + ':' + format(minute)

})
Vue.filter('time', function (date) {
  date = new Date(date)
  var hour = date.getHours()
  var minute = date.getMinutes()
  return hour + ':' + format(minute)
})

function format(num) {
    return num < 10 ? '0' + num : num
}